﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace BrainMatch
{
    public partial class NewFenleiDialog : Form
    {
        public string FenleiName
        {
            get
            {
                return textBox1.Text;
            }
        }

        public Color FenleiColor
        {
            get
            {
                return button1.BackColor;
            }
        }
        public string FenleiRemark
        {
            get
            {
                return textBox2.Text;
            }
        }

        public NewFenleiDialog()
        {
            InitializeComponent();
        }

        private void OnSelectColor(object sender, EventArgs e)
        {
            if (colorDialog1.ShowDialog() == DialogResult.OK)
            {
                button1.BackColor = colorDialog1.Color;
            }
        }

        private void NewFenleiDialog_Load(object sender, EventArgs e)
        {
            Random r = new Random();
            Color c = Color.FromArgb(r.Next() % 256, r.Next() % 256, r.Next() % 256);
            button1.BackColor = c;
        }
    }
}
